<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        @session_start();
        include_once 'templates/render.php';
        $render = new render();
        $arrFileCss = array(
            'style.css',
            'login.css',
            'cart-style.css',
            'jquery.ui.all.css',
            'demos.css');
        $render->renderCSS($arrFileCss);
        $arrFileJquery = array(
            'jquery-1.10.2.js',
            'jquery.ui.button.js',
            'jquery.ui.core.js',
            'jquery.ui.mouse',
            'jquery.ui.widget.js',
            'jquery.ui.draggable.js',
            'jquery.ui.position.js',
            'jquery.ui.dialog.js');
        $render->renderJS($arrFileJquery);
        if (!isset($_SESSION['user'])) {
            if (CONTROLLER == 'Index' && ACTION == 'index') {
                include_once TEMPLATE;
            } else {
                header('Location: ' . URL_BASE . '/admin');
            }
        } else {
            if(CONTROLLER == 'Index' && ACTION == 'index'){
                header('Location: ' . URL_BASE . '/admin/home');
            }
            ?>
            <div id="wrapper">
                <?php include 'template/header_admin.php'; ?>
                <div id="main">
                    <?php include TEMPLATE; ?>
                </div>
                <?php include 'template/footer.php'; ?>
            </div>

            <?php
        }
        ?>
    </body>
</html>
